From: Philip Withnall Date: Wed, 2 Apr 2025 11:05:43 +0000 (+0100) Subject: breakManager: Fix a potential null object dereference X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~139^2^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e280cc965164f388413e47bce23b9383e3d2d5ed;p=gnome-shell.git breakManager: Fix a potential null object dereference There’s no `else` branch above, so it’s possible for `this._notification` to be `null` at the bottom of the function (especially if the user has explicitly closed the previous notification), so handle that. Signed-off-by: Philip Withnall Helps: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8280 Part-of: --- diff --git a/js/misc/breakManager.js b/js/misc/breakManager.js index 42e7c3569..371201a7a 100644 --- a/js/misc/breakManager.js +++ b/js/misc/breakManager.js @@ -1278,8 +1278,11 @@ class BreakNotificationSource extends GObject.Object { this._scheduleUpdateState(updateTimeoutSeconds); } - this._notification.urgency = this._urgencyForBreakType(this._manager.currentBreakType); - this._source.addNotification(this._notification); + if (this._notification) { + this._notification.urgency = this._urgencyForBreakType(this._manager.currentBreakType); + this._source.addNotification(this._notification); + } + break; }